export function withLoading(vm, text = '处理中...') {
    return async (asyncFunc) => {
        const loadingInstance = vm.$loading({
            lock: true,
            text: text,
            spinner: 'el-icon-loading',
            background: 'rgba(0, 0, 0, 0.7)'
        });

        try {
            return await asyncFunc();
        } finally {
            loadingInstance.close();
        }
    };
}